function green( self ) {
    green_draw_realy_bg( self );
    green_draw_user_face( self );
    green_draw_dipai( self );
    green_draw_dipai_number( self );
    green_draw_setting( self );
    green_draw_jiao( self );
}
function green_draw_realy_bg(self) {
    self.realy_bg   = cc.Sprite.create( res.Realy_BG );
    self.realy_bg.setScale(1.3);
    self.realy_bg.x = self.realy_size.width / 2;
    self.realy_bg.y = self.realy_size.height / 2;
    self.addChild(self.realy_bg,0);
    var bm_line = cc.Sprite.create( "res/bm_line.png" );
    bm_line.x = self.realy_size.width / 2;
    bm_line.y = 6.5;
    self.addChild( bm_line , 99990 );
}
//绘制桌面四角
function green_draw_jiao(self) {
    var lb_j = cc.Sprite.create( "res/green/lb_j.png" );lb_j.x = 14.5;lb_j.y = 14.5;self.addChild( lb_j , 99991 );
    var rb_j = cc.Sprite.create( "res/green/rb_j.png" );rb_j.x = self.realy_size.width - 14.5 ;rb_j.y = 14.5;self.addChild( rb_j , 99991 );
    var lt_j = cc.Sprite.create( "res/green/lt_j.png" );lt_j.x = 14.5;lt_j.y = self.realy_size.height - 14.5;self.addChild( lt_j , 99991 );
    var rt_j = cc.Sprite.create( "res/green/rt_j.png" );rt_j.x = self.realy_size.width - 14.5;rt_j.y = self.realy_size.height - 14.5;self.addChild( rt_j , 99991 );
    var left_s  = cc.Sprite.create( "res/green/left_s.png" );left_s.x = 5;left_s.y = 5.5;self.addChild( left_s );
    var right_s = cc.Sprite.create( "res/green/right_s.png" );right_s.x = self.realy_size.width - 5.6;right_s.y = 5.5;self.addChild( right_s );
    var t_line  = cc.Sprite.create( "res/green/t_line.png" );t_line.x = self.realy_size.width / 2;t_line.y = self.realy_size.height - 9;self.addChild( t_line );
    var t_show  = cc.Sprite.create( "res/green/t_show.png" );t_show.x = self.realy_size.width / 2;t_show.y = self.realy_size.height - 18.5;self.addChild( t_show );
}
//绘制桌面底牌
function green_draw_dipai(self){
    //展示桌面上的底牌墩&放23张底牌&放上一个23的数字
    var room_dipaiDun = cc.Sprite.create( "res/zp_dun.png" );
    room_dipaiDun.x   = self.realy_size.width / 2;
    room_dipaiDun.y   = self.realy_size.height - 100;
    self.addChild( room_dipaiDun , 10000 );
    for( var i =1 ; i <= 23 ; i++ ){
        var temp = cc.Sprite.create( "res/zp_bei.png" );
        temp.x   = self.realy_size.width / 2;
        temp.y   = self.realy_size.height - 100 + i;
        MISCE.push( temp );//添加杂项
        self.addChild( temp , 10000 + i );
    }
}
//绘制桌面设置，语音，聊天按钮
function green_draw_setting(self){
    var Button = new ccui.Button();Button.setTouchEnabled(true);
    Button.setPressedActionEnabled(true);Button.loadTextures( "res/green/sz2.png" , "res/green/sz.png" );
    Button.x = 70;Button.y = self.realy_size.height / 2;
    Button.setScale(1.3);
    self.addChild(Button , 8887);
    var Button = new ccui.Button();Button.setTouchEnabled(true);
    Button.setPressedActionEnabled(true);Button.loadTextures( "res/green/yy2.png" , "res/green/yy.png" );
    Button.x = self.realy_size.width - 70;Button.y = self.realy_size.height / 2 + 60;
    self.addChild(Button , 8887);
    Button.setScale(1.3);
    var Button = new ccui.Button();Button.setTouchEnabled(true);
    Button.setPressedActionEnabled(true);Button.loadTextures( "res/green/lt2.png" , "res/green/lt.png" );
    Button.x = self.realy_size.width - 70;Button.y = self.realy_size.height / 2 - 60;
    self.addChild(Button , 8887);
    Button.setScale(1.3);
}
//绘制桌面底牌上的牌剩余数量，这个因为是变动的，所以做成单独方法
function green_draw_dipai_number(self){
    if( self.DIPAI_NUM != null ){
        self.removeChild( self.DIPAI_NUM );
    }
    self.DIPAI_NUM   = new cc.LabelTTF( GAME_DP_NUM , "Arial" , 24 );
    self.DIPAI_NUM.x = self.realy_size.width / 2;self.DIPAI_NUM.y   = self.realy_size.height - 100 + 25;
    self.addChild( self.DIPAI_NUM , 10040 );
}
//绘制默认为0的胡息&总分
function green_draw_huxiANDscore( self ){
    //自己的
    self.ZJ_ZF_TEXT = new cc.LabelTTF( ZJ_ZF ,'Arial' , 24 );self.ZJ_ZF_TEXT.x  = 100 ;self.ZJ_ZF_TEXT.y  = ROOM_FACE_CPOINT + 100;self.addChild(self.ZJ_ZF_TEXT,1);
    self.ZJ_HX_TEXT = new cc.LabelTTF( ZJ_HX ,'Arial' , 24 );self.ZJ_HX_TEXT.x  = 100 ;self.ZJ_HX_TEXT.y  = 130;self.addChild(self.ZJ_HX_TEXT,1);
    //下家的
    self.XJ_ZF_TEXT = new cc.LabelTTF( XJ_ZF ,'Arial' , 24 );self.XJ_ZF_TEXT.x  = self.realy_size.width - 35 ;self.XJ_ZF_TEXT.y  = ROOM_FACE_CPOINT + 100;self.addChild(self.XJ_ZF_TEXT,1);
    self.XJ_HX_TEXT = new cc.LabelTTF( XJ_HX ,'Arial' , 24 );self.XJ_HX_TEXT.x  = self.realy_size.width - 35 ;self.XJ_HX_TEXT.y  = 130;self.addChild(self.XJ_HX_TEXT,1);
    //上家的
    self.SJ_ZF_TEXT = new cc.LabelTTF( SJ_ZF ,'Arial' , 24 );self.SJ_ZF_TEXT.x  = 205 ;self.SJ_ZF_TEXT.y  = self.realy_size.height - 72;self.addChild(self.SJ_ZF_TEXT,1);
    self.SJ_HX_TEXT = new cc.LabelTTF( SJ_HX ,'Arial' , 24 );self.SJ_HX_TEXT.x  = 205 ;self.SJ_HX_TEXT.y  = self.realy_size.height - 107;self.addChild(self.SJ_HX_TEXT,1);
    //对家的
    self.DM_ZF_TEXT = new cc.LabelTTF( DM_ZF ,'Arial' , 24 );self.DM_ZF_TEXT.x  = self.realy_size.width - 135 ;self.DM_ZF_TEXT.y  = self.realy_size.height - 72;self.addChild(self.DM_ZF_TEXT,1);
    self.DM_HX_TEXT = new cc.LabelTTF( DM_HX ,'Arial' , 24 );self.DM_HX_TEXT.x  = self.realy_size.width - 135 ;self.DM_HX_TEXT.y  = self.realy_size.height - 107;self.addChild(self.DM_HX_TEXT,1);
}
//更新底分 + 牌局结束，重绘胡息数
function green_draw_huxiANDscore_replace( self , log_data , is_chonghui ){
    if( is_chonghui == true ){
        self.ZJ_HX_TEXT.setString( "0" );
        self.XJ_HX_TEXT.setString( "0" );
        self.SJ_HX_TEXT.setString( "0" );
        self.DM_HX_TEXT.setString( "0" );
    }else {
        self.ZJ_ZF_TEXT.setString(log_data["zf_" + PB_USER_UID]);
        self.ZJ_HX_TEXT.setString(log_data["hx_" + PB_USER_UID]);
        self.XJ_ZF_TEXT.setString(log_data["zf_" + ROOM_WS_XJ]);
        self.XJ_HX_TEXT.setString(log_data["hx_" + ROOM_WS_XJ]);
        self.SJ_ZF_TEXT.setString(log_data["zf_" + ROOM_WS_SJ]);
        self.SJ_HX_TEXT.setString(log_data["hx_" + ROOM_WS_SJ]);
        self.DM_ZF_TEXT.setString(log_data["zf_" + ROOM_WS_DM]);
        self.DM_HX_TEXT.setString(log_data["hx_" + ROOM_WS_DM]);
    }
}
//绘制四个边角用户头像框及名称、胡息元素
function green_draw_user_face(self){
    self.realy_user_face_1   = cc.Sprite.create( res.Realy_FACE );
    self.realy_user_face_1.x = ROOM_FACE_CPOINT + 5;
    self.realy_user_face_1.y = ROOM_FACE_CPOINT + 2;
    self.realy_user_face_2   = cc.Sprite.create( res.Realy_FACE );
    self.realy_user_face_2.x = self.realy_size.width - ROOM_FACE_CPOINT - 5;
    self.realy_user_face_2.y = ROOM_FACE_CPOINT + 2;
    self.realy_user_face_3   = cc.Sprite.create( res.Realy_FACE );
    self.realy_user_face_3.x = self.realy_size.width - ROOM_FACE_CPOINT;
    self.realy_user_face_3.y = self.realy_size.height - ROOM_FACE_CPOINT - 12;
    self.realy_user_face_4   = cc.Sprite.create( res.Realy_FACE );
    self.realy_user_face_4.x = ROOM_FACE_CPOINT;
    self.realy_user_face_4.y = self.realy_size.height - ROOM_FACE_CPOINT - 12;
    self.realy_user_face_1.setScale(0.9);
    self.realy_user_face_2.setScale(0.9);
    self.realy_user_face_3.setScale(0.9);
    self.realy_user_face_4.setScale(0.9);
    self.addChild( self.realy_user_face_1 , 99992 );
    self.addChild( self.realy_user_face_2 , 99992 );
    self.addChild( self.realy_user_face_3 , 99992 );
    self.addChild( self.realy_user_face_4 , 99992 );
    var info   = cc.Sprite.create( "res/green/info.png" );
    info.x = 120;
    info.y = self.realy_size.height - 75;
    self.addChild( info );
    var info   = cc.Sprite.create( "res/green/info.png" );
    info.x = self.realy_size.width - 120;
    info.y = self.realy_size.height - 75;
    self.addChild( info );
    var info   = cc.Sprite.create( "res/green/info2.png" );
    info.x = 70;
    info.y = 80;
    self.addChild( info );
    var info   = cc.Sprite.create( "res/green/info2.png" );
    info.x = self.realy_size.width - 70;
    info.y = 80;
    self.addChild( info );
    green_draw_huxiANDscore( self );
}
//绘制用户头像默认框以及总分胡息text
function green_draw_userFaceTEXT( self , DATA ) {
    //自己
    if( self.ws_user_1 == null && ROOM_WS_MY == 0 && DATA.log_data.mu != 0 ){
        self.ws_user_1    = new cc.LabelTTF( DATA.log_data.mn ,'Arial' , 24 );
        self.ws_user_1.x  = ROOM_FACE_CPOINT - 5;
        self.ws_user_1.y  = ROOM_FACE_CPOINT + 135;
        self.ws_user_1.setColor( cc.color( DEFAULT_NAME_COLOR[0] , DEFAULT_NAME_COLOR[1] , DEFAULT_NAME_COLOR[2] ) );
        self.addChild(self.ws_user_1,1);
        var temp = new cc.LabelTTF( "总分：" ,'Arial' , 24 );
        temp.x  = ROOM_FACE_CPOINT - 5 ;
        temp.y  = ROOM_FACE_CPOINT + 100;
        self.addChild(temp,1);
        var temp = new cc.LabelTTF( "胡息：" ,'Arial' , 24 );
        temp.x  = ROOM_FACE_CPOINT - 5 ;
        temp.y  = 130;
        self.addChild(temp,1);
        ROOM_WS_MY        = PB_USER_UID;
        //我的具体头像
        cc.loader.loadImg( "face/"+ ROOM_WS_MY +".jpg" ,{isCrossOrigin : false},function( error , data ){
            self.removeChild( self.realy_user_face_1 );
            self.realy_user_face_1   = cc.Sprite.create( "res/green/trip/default_kuang.png" );
            self.realy_user_face_1.x = ROOM_FACE_CPOINT + 5;
            self.realy_user_face_1.y = ROOM_FACE_CPOINT + 2;
            self.addChild( self.realy_user_face_1 , 99992 );
            var texture2d = new cc.Texture2D();
            texture2d.initWithElement( data );
            texture2d.handleLoadedTexture();
            tx = cc.Sprite.create( texture2d );
            tx.x = ROOM_FACE_CPOINT + 5;
            tx.y = ROOM_FACE_CPOINT + 3;
            tx.setScale(0.3);
            self.addChild( tx , 99991 );
        });
    }
    //下家
    if( self.ws_user_2 == null && ROOM_WS_XJ == 0 && DATA.log_data.xu != 0 ){
        self.ws_user_2    = new cc.LabelTTF( DATA.log_data.xn ,'Arial' , 24 );
        self.ws_user_2.x  = self.realy_size.width - ROOM_FACE_CPOINT - 15;
        self.ws_user_2.y  = ROOM_FACE_CPOINT + 135;
        self.ws_user_2.setColor( cc.color( DEFAULT_NAME_COLOR[0] , DEFAULT_NAME_COLOR[1] , DEFAULT_NAME_COLOR[2] ) );
        self.addChild(self.ws_user_2,1);
        var temp = new cc.LabelTTF( "总分：" ,'Arial' , 24 );
        temp.x  = self.realy_size.width - ROOM_FACE_CPOINT - 15 ;
        temp.y  = ROOM_FACE_CPOINT + 100;
        self.addChild(temp,1);
        var temp = new cc.LabelTTF( "胡息：" ,'Arial' , 24 );
        temp.x  = self.realy_size.width - ROOM_FACE_CPOINT - 15 ;
        temp.y  = 130;
        self.addChild(temp,1);
        ROOM_WS_XJ        = DATA.log_data.xu;
        //我的下家具体头像
        cc.loader.loadImg( "face/"+ ROOM_WS_XJ +".jpg" ,{isCrossOrigin : false},function( error , data ){
            self.removeChild( self.realy_user_face_2 );
            self.realy_user_face_2   = cc.Sprite.create( "res/green/trip/default_kuang.png" );
            self.realy_user_face_2.x = self.realy_size.width - ROOM_FACE_CPOINT - 5;
            self.realy_user_face_2.y = ROOM_FACE_CPOINT + 2;
            self.addChild( self.realy_user_face_2 , 99992 );
            var texture2d = new cc.Texture2D();
            texture2d.initWithElement( data );
            texture2d.handleLoadedTexture();
            tx = cc.Sprite.create( texture2d );
            tx.x = self.realy_size.width - ROOM_FACE_CPOINT - 5;
            tx.y = ROOM_FACE_CPOINT + 3;
            tx.setScale(0.3);
            self.addChild( tx , 99991 );
        });
    }
    //对家
    if( self.ws_user_3 == null && ROOM_WS_DM == 0 && DATA.log_data.du != 0 ){
        self.ws_user_3    = new cc.LabelTTF( DATA.log_data.dn ,'Arial' , 24 );
        self.ws_user_3.setColor( cc.color( DEFAULT_NAME_COLOR[0] , DEFAULT_NAME_COLOR[1] , DEFAULT_NAME_COLOR[2] ) );
        self.ws_user_3.x  = self.realy_size.width - ROOM_FACE_CPOINT - 95 ;
        self.ws_user_3.y  = self.realy_size.height - 40;
        self.addChild(self.ws_user_3,1);
        var temp = new cc.LabelTTF( "总分：" ,'Arial' , 24 );
        temp.x  = self.realy_size.width - ROOM_FACE_CPOINT -  120;
        temp.y  = self.realy_size.height - 72;
        self.addChild(temp,1);
        var temp = new cc.LabelTTF( "胡息：" ,'Arial' , 24 );
        temp.x  = self.realy_size.width - ROOM_FACE_CPOINT -  120;
        temp.y  = self.realy_size.height - 107;
        self.addChild(temp,1);
        ROOM_WS_DM        = DATA.log_data.du;
        //我的对家具体头像
        cc.loader.loadImg( "face/"+ ROOM_WS_DM +".jpg" ,{isCrossOrigin : false},function( error , data ){
            self.removeChild( self.realy_user_face_3 );
            self.realy_user_face_3   = cc.Sprite.create( "res/green/trip/default_kuang.png" );
            self.realy_user_face_3.x = self.realy_size.width - ROOM_FACE_CPOINT;
            self.realy_user_face_3.y = self.realy_size.height - ROOM_FACE_CPOINT - 12;
            self.addChild( self.realy_user_face_3 , 99992 );
            var texture2d = new cc.Texture2D();
            texture2d.initWithElement( data );
            texture2d.handleLoadedTexture();
            tx = cc.Sprite.create( texture2d );
            tx.x = self.realy_size.width - ROOM_FACE_CPOINT;
            tx.y = self.realy_size.height - ROOM_FACE_CPOINT - 12;
            tx.setScale(0.3);
            self.addChild( tx , 99991 );
        });
    }
    //上家
    if( self.ws_user_4 == null && ROOM_WS_SJ == 0 && DATA.log_data.su != 0 ){
        self.ws_user_4    = new cc.LabelTTF( DATA.log_data.sn ,'Arial' , 24 );
        self.ws_user_4.setColor( cc.color( DEFAULT_NAME_COLOR[0] , DEFAULT_NAME_COLOR[1] , DEFAULT_NAME_COLOR[2] ) );
        self.ws_user_4.x  = ROOM_FACE_CPOINT + 95;
        self.ws_user_4.y  = self.realy_size.height - 40;
        self.addChild(self.ws_user_4,1);
        var temp = new cc.LabelTTF( "总分：" ,'Arial' , 24 );
        temp.x  = ROOM_FACE_CPOINT + 95;
        temp.y  = self.realy_size.height - 72;
        self.addChild(temp,1);
        var temp = new cc.LabelTTF( "胡息：" ,'Arial' , 24 );
        temp.x  = ROOM_FACE_CPOINT + 95;
        temp.y  = self.realy_size.height - 107;
        self.addChild(temp,1);
        ROOM_WS_SJ        = DATA.log_data.su;
        //我的上家具体头像
        cc.loader.loadImg( "face/"+ ROOM_WS_SJ +".jpg" ,{isCrossOrigin : false},function( error , data ){
            self.removeChild( self.realy_user_face_4 );
            self.realy_user_face_4   = cc.Sprite.create( "res/green/trip/default_kuang.png" );
            self.realy_user_face_4.x = ROOM_FACE_CPOINT;
            self.realy_user_face_4.y = self.realy_size.height - ROOM_FACE_CPOINT - 12;
            self.addChild( self.realy_user_face_4 , 99992 );
            var texture2d = new cc.Texture2D();
            texture2d.initWithElement( data );
            texture2d.handleLoadedTexture();
            tx = cc.Sprite.create( texture2d );
            tx.x = ROOM_FACE_CPOINT;
            tx.y = self.realy_size.height - ROOM_FACE_CPOINT - 12;
            tx.setScale(0.3);
            self.addChild( tx , 99991 );
        });
    }
    //////////////////////////////////////////  设置本局庄家标识 /////////////////////////////////////////////////////
    var zhuangjia = cc.Sprite.create( res.TRIP_zhuang );
    self.addChild( zhuangjia , 99993 );
    if( DATA.log_data.put_uid == PB_USER_UID ){
        zhuangjia.x = 100;
        zhuangjia.y = 100;
    }
    if( DATA.log_data.put_uid == ROOM_WS_XJ ){
        zhuangjia.x = self.realy_size.width - 100;
        zhuangjia.y = 100;
    }
    if( DATA.log_data.put_uid == ROOM_WS_SJ ){
        zhuangjia.x = 100;
        zhuangjia.y = self.realy_size.height - 110;
    }
    if( DATA.log_data.put_uid == ROOM_WS_DM ){
        zhuangjia.x = self.realy_size.width - 100;
        zhuangjia.y = self.realy_size.height - 110;
    }
    MISCE.push( zhuangjia );
    //////////////////////////////////////////  设置本局庄家标识 /////////////////////////////////////////////////////
}

function green_user_realy( realy_uid ) {
    var self = PL_Room_Play;
    var zhunbei = cc.Sprite.create( res.TRIP_zhunbei );
    self.addChild( zhunbei );
    if( realy_uid == PB_USER_UID ){
        zhunbei.x = 170;
        zhunbei.y = 150;
    }
    if( realy_uid == ROOM_WS_XJ ){
        zhunbei.x = self.realy_size.width - 170;
        zhunbei.y = 150;
    }
    if( realy_uid == ROOM_WS_SJ ){
        zhunbei.x = 170;
        zhunbei.y = self.realy_size.height - 170;
    }
    if( realy_uid == ROOM_WS_DM ){
        zhunbei.x = self.realy_size.width - 170;
        zhunbei.y = self.realy_size.height - 170;
    }
    MISCE.push( zhunbei );
}